<template>
  <a-modal
    :visible="visible"
    :title="title"
    okText='保存'
    cancelText='关闭'
    :width="500"
    @cancel="() => { $emit('cancel') }"
    @ok="handleSave"
  >
    <a-form :form="form">
      <a-row v-if="!isBatchCheck">
        <a-form-item
          label="学号"
          :labelCol="{span: 3,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          {{ info.xh }}
        </a-form-item>
      </a-row>
      <a-row v-if="!isBatchCheck">
        <a-form-item
          label="姓名"
          :labelCol="{span: 5,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          {{ info.xm }}
        </a-form-item>
      </a-row>
      <a-row v-if="!isBatchCheck">
        <a-form-item
          label="职务"
          :labelCol="{span: 5,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          {{ info.zw }}
        </a-form-item>
      </a-row>
      <a-row v-if="!isBatchCheck">
        <a-form-item
          label="先进事迹"
          :labelCol="{span: 5,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          {{ info.xjsj }}
        </a-form-item>
      </a-row>
      <a-row>
        <a-form-item
          label="审核状态"
          :labelCol="{span: 5,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select disable v-decorator="['yxshzt',
            {
              rules: [{ required: true, message: '请选择审核状态!' }],
            }]">
            <a-select-option value="05">通过</a-select-option>
            <a-select-option value="06">不通过</a-select-option>
          </a-select>
        </a-form-item>
      </a-row>
      <a-row>
        <a-form-item
          label="审核意见"
          :labelCol="{span: 5,offset: 1}"
          :wrapperCol="{span: 17, offset: 1}"
        >
          <a-textarea v-decorator="['yxshyj',
            {
              rules: [{ required: true, message: '请填写审核意见!' }],
            }]"/>
        </a-form-item>
      </a-row>
    </a-form>
  </a-modal>
</template>

<script>
export default {
  props: ['title', 'visible'],
  data() {
    return {
      info: {},
      form: this.$form.createForm(this),
      isBatchCheck: false
    }
  },
  methods: {
    handleSave() {
      this.form.validateFields((err, values) => {
        if (err) {
          return
        }
        this.$api.student.shyjsCheck(Object.assign({shyjsId: this.info.id}, values)).then(res => {
          this.$message.success(res.msg)
          this.$emit('cancel')
          this.$emit('refresh')
        })
      })
    }
  }
}
</script>

<style>

</style>
